syntax on
set nocompatible
set backspace=indent,eol,start
set number
set tabstop=4
set shiftwidth=4
set expandtab
"解决出现未知的选项amd64问题
set nomodeline
"搜索后高亮搜索结果
set hlsearch
""set laststatus=2
"" 显示匹配括号
set showmatch
"" 不折叠
set nowrap

"" 缩进方式
"set autoindent
""set smartindent
""set cindent
""set indentexpr

""""""""""""""""""""""""""""""""""""""""""""""
"禁用选中后进入可视化"
if has('mouse')
    set mouse-=a
endif

"设置python文件时特有的输入"
function SetPythonFileInput()
    inoremap ' ''<ESC>i
    inoremap " ""<ESC>i
    inoremap ( ()<ESC>i
    inoremap [ []<ESC>i
    inoremap { {}<ESC>i
    inoremap __n __name__ == "__main__":<ESC>o<TAB>pass<ESC>o
    set smartindent
endfunction
autocmd BufNewFile,BufRead *.py call SetPythonFileInput()

"设置编辑java文件特有的输入"
function SetJavaFileInput()
    set autoindent
    inoremap " ""<ESC>i
    inoremap ' ''<ESC>i
    inoremap ( ();<ESC>hi
    inoremap .( ()<ESC>hi
    inoremap [ []<ESC>i
    inoremap { {}<ESC>i<ENTER><ESC>O<TAB>
    inoremap /*  /**/<ESC>hi
    inoremap # //<ESC>
    "java常用简写
    inoremap sout System.out.println();<ESC>hi
    inoremap pk package<SPACE>
    inoremap pc public class<SPACE>
    inoremap jm public static void main(String[] args) {}<ESC>i<ENTER><ESC>O<TAB>
    inoremap @O @Override<ESC>o
    inoremap tS @Override<ESC>opublic String toString() {}<ESC>i<ENTER><ESC>O<TAB>return ;<ESC>
endfunction
autocmd BufNewFile,BufRead *.java call SetJavaFileInput()

""shell专用
function SetShellFileInput()
    inoremap [ [  ]<ESC>hi
endfunction
autocmd BufNewFile,BufRead *.sh call SetShellFileInput()

""其他配置
iab mliwl <c-r>=strftime("common by liwl,%Y-%m-%d %H:%M:%S")<cr>
"配色
colorscheme default
